import React from 'react';
import { InputNumber } from 'antd';
import { AxFormItemBase } from '../lib/AxFormItemBase';
import { AxLabel } from '@/components/AxBase';
import { AxInputNumberProps } from './AxInputNumberProps';

export const AxInputNumber: React.FC<AxInputNumberProps> = props => {
  const {
    isLabel = false,
    // step = 0.01,
    // precision = 2,//默认精度
    ...rest
  } = props;
  /** 展示为Label */
  const WrappedComponent = isLabel === true ? AxLabel : InputNumber;
  const localProps = {
    // step: step,
    // precision: precision,
  };

  return <AxFormItemBase
    WrappedComponent={WrappedComponent}
    style={{ width: '100%' }}
    {...localProps}
    {...rest}
  />;
};
